﻿
/* 广告*/
var t = n = 0; var count;
$(function () {
    count = $("#playShow a").size();
    $("#playShow a:not(:first-child)").hide();
    $("#playText").html($("#playShow a:first-child").find("img").attr('alt'));
    $("#playNum a:first").css({ "background": "#FD7C00", 'color': '#fff', "border": '1px solid #FD7C00', "border-top": '0' });
    $("#playText").click(function () { window.open($("#playShow a:first-child").attr('href'), "_blank") });
    $("#playNum a").bind("click mouseover", function () {
        var i = $(this).text() - 1;
        n = i;
        if (i >= count) return;
        $("#playText").html($("#playShow a").eq(i).find("img").attr('alt'));
        $("#playText").unbind().click(function () { window.open($("#playShow a").eq(i).attr('href'), "_blank") })
        $("#playShow a").filter(":visible").hide().parent().children().eq(i).fadeIn(1000);
        $(this).css({ "background": "#FD7C00", 'color': '#fff', "border": '1px solid #FD7C00', "border-top": '0' }).siblings().css({ "background": "#fff", 'color': '#666', "border": '1px solid #d7d7d7', "border-top": '0' });
    });
    t = setInterval("showAuto()", 5000);
    $("#play").hover(function () { clearInterval(t) }, function () {
        t = setInterval("showAuto()", 5000);
    });
});
function showAuto() {
    n = n >= (count - 1) ? 0 : ++n;
    $("#playNum a").eq(n).trigger('click');
}
